package com.huahua.api.service;

import com.huahua.api.entity.developTool.github.vo.GithubGetBranchListVO;
import com.huahua.api.entity.developTool.github.vo.GithubObtainInfoVo;
import com.huahua.api.entity.param.GithubBaseParam;
import com.huahua.api.enums.GithubAddressTypeEnum;
import org.eclipse.jgit.api.errors.GitAPIException;

import java.io.IOException;
import java.util.List;

/**
 * @author LoveHuaHua
 * @date 2025年02月27日 20:32
 * @description believe in yourself
 */
public interface GithubService {

    /**
     * 根据github地址 返回该地址的类型
     *
     * @param param param
     * @return {@link GithubAddressTypeEnum }
     */
    GithubObtainInfoVo getInfo(GithubBaseParam param) throws GitAPIException, IOException;


    /**
     * 获取该github的所有分支
     *
     * @param param param
     * @return {@link List }<{@link String }>
     */
    List<GithubGetBranchListVO> getBranches(GithubBaseParam param) throws GitAPIException, IOException;

    /**
     * 下载
     *
     * @param param param
     * @return {@link String }
     */
    String download(GithubBaseParam param) throws GitAPIException, IOException;

    /**
     * 下载 zip
     *
     * @param param param
     * @return {@link String }
     */
    String downloadZip(GithubBaseParam param) throws GitAPIException, IOException;
}
